#include<iostream>
#include<cmath>
using namespace std;

bool IsPrime(int a)
{
	if(a < 2)
		return false;
    if(a == 2)
        return true;
	if (a % 2 == 0)
		return false;
	for (int i = 3; i <= sqrt(a); i += 2)
	{
		if (a % i == 0)
			return false;
	}
	return true;
}

int main()
{
	int x = 0, k = 0;
	cin >> x >> k;
	if (x % 2 == 0)
		x++;
	int times = 0;
	for (; times < k; x += 2)
	{
		if (IsPrime(x))
		{
			cout << x << " ";
			times++;
			if (times % 5 == 0)
				cout << endl;
		}
	}
	return 0;
}
